<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<div class="manageList">
	<form action="categoryList.do" name="selector" method="get">		
		<table class="selector">
			<tr>
				<td>
					<select name="searchMarket">
						<option value="all">ALL</option>
						<option value="outer">OUTER</option>
						<option value="top">TOP</option>
						<option value="bottom">BOTTOM</option>
						<option value="dress">DRESS</option>
						<option value="shoes">SHOES</option>
						<option value="accessary">ACCESSARY</option>
					</select>
					<input type="submit" value="조회">			
					<input type="button" value="등록" onclick="location.href='categoryWrite.do?pageNum=${pageNum}&searchMarket=${market}'">
				</td>
			</tr>
		</table>
	</form>
	<table class="list">		
		<tr>
			<th>번호</th>
			<th>대분류</th>
			<th>카테고리명</th>
			<th>전시여부</th>
			<th>편집</th>
		</tr>
		<c:forEach var="article" items="${list}">
		<tr>
			<td>${number} <c:set var="number" value="${number-1}" /></td>
			<td>${article.market}</td>
			<td>${article.category}</td>
			<td>${article.show}</td>
			<td>
				<c:if test="${article.show == 'y'}">
					<input type="button" value="비공개" onclick="location.href='categoryShowToggle.do?c_code=${article.c_code}&pageNum=${pageNum}&searchMarket=${market}'">
				</c:if> <c:if test="${article.show == 'n'}">
					<input type="button" value="공개" onclick="location.href='categoryShowToggle.do?c_code=${article.c_code}&pageNum=${pageNum}&searchMarket=${market}'">
				</c:if>
				<input type="button" value="수정" onclick="location.href='categoryUpdate.do?c_code=${article.c_code}&pageNum=${pageNum}&searchMarket=${market}'">				
				<input type="button" value="삭제" onclick="location.href='categoryDelete.do?c_code=${article.c_code}&pageNum=${pageNum}&searchMarket=${market}'">				
			</td>
		</tr>
		</c:forEach>
		<c:if test="${count == 0}">
		<tr>
			<td colspan="5">표시할 내용이 없습니다.</td>
		</tr>
		</c:if>
	</table>
	<table class="page">
		<c:if test="${count>0}">
		<tr>
			<td>${pagingHtml}</td>
		</tr>
		</c:if>
	</table>
</div>
